package vistajuego.objetos;

import vistajuego.ObjetoVivo;
import vistajuego.Posicionable;


public class Pelota implements Posicionable, ObjetoVivo {
	public Pelota(){
		this.sentidoX = 1;
		this.sentidoY = 1;
		this.x = 20;
		this.y = 20;
	}
	
	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	public void vivir() {
		//x += this.sentidoX;
		//x += this.sentidoX;
		y +=this.sentidoY;
		if(x >= this.pantalla.getAncho() || x < 0){
			this.sentidoX = -1 * this.sentidoX;
		}
		if(y >= this.pantalla.getAlto() || y < 0){
			this.sentidoY = -1 * this.sentidoY;
		}		
	}


private int x;
private int y;
private int sentidoX;
private int sentidoY;
private Pantalla pantalla;

public Pantalla getPantalla() {
	return pantalla;
}

public void setPantalla(Pantalla pantalla) {
	this.pantalla = pantalla;
}


}

